import React from "react";
import { List, Button, Tag, Space } from "antd";
import { DownloadOutlined, FileOutlined } from "@ant-design/icons";

interface CourseResource {
  id: string;
  name: string;
  type: string;
  size: string;
  uploadTime: string;
}

const CourseResources: React.FC = () => {
  const mockResources: CourseResource[] = [
    {
      id: "1",
      name: "课程大纲.pdf",
      type: "PDF",
      size: "2.5MB",
      uploadTime: "2024-03-15",
    },
  ];

  return (
    <List
      itemLayout="horizontal"
      dataSource={mockResources}
      renderItem={(item) => (
        <List.Item
          actions={[
            <Button key="download" type="link" icon={<DownloadOutlined />}>
              下载
            </Button>,
          ]}
        >
          <List.Item.Meta
            avatar={<FileOutlined style={{ fontSize: 24 }} />}
            title={item.name}
            description={
              <Space>
                <Tag color="blue">{item.type}</Tag>
                <span>{item.size}</span>
                <span>上传时间：{item.uploadTime}</span>
              </Space>
            }
          />
        </List.Item>
      )}
    />
  );
};

export default CourseResources;
